package com.biz.primus.ms.order.promotion;

import com.biz.primus.base.enums.PromotionTypeEnum;
import com.biz.primus.model.order.vo.request.OrderRequestVO;
import com.biz.primus.model.promotion.vo.OrderPromotionDetailVo;
import com.biz.primus.ms.order.promotion.helper.OrderPromotionHelper;

/**
 * 首单促销
 * <p>USER_FIRST_ORDER_CUT("首单立减", "减")</p>
 *
 * @author Tiger Feng
 * @date 2017年11月10日
 */
public class FirstOrderCutPromotionHandler extends AbstractPromotionHandler {
    private FirstOrderCutPromotionHandler() {
    }

    public FirstOrderCutPromotionHandler(OrderPromotionDetailVo orderPromotionDetailVo, OrderRequestVO orderRequestVO, OrderPromotionHelper helper) {
        super(orderPromotionDetailVo, orderRequestVO, helper);
    }

    @Override
    public boolean checkPromotionType() {
        return PromotionTypeEnum.USER_FIRST_ORDER_CUT == orderPromotionDetailVo.getPromotionType();
    }

    @Override
    public void count() {
        orderRequestVO.setFirstOrderCutPromotionAmount(orderPromotionDetailVo.getCutAmount());
    }
}
